﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Trans.order
{
    public partial class Query_allOrders : Form
    {
        private static int C_DETAIL_INDEX;
        public Query_allOrders()
        {
            InitializeComponent();
        }

        private void Query_allOrders_Load(object sender, EventArgs e)
        {
            C_DETAIL_INDEX = gv_order.Columns["c_detail"].Index;
        }

        private void bt_query_Click(object sender, EventArgs e)
        {
            vw_orderTableAdapter.FillByQStr(dataSet_view.vw_order, tx_qstr.Text);
            session.Color_Const.set_gv_color(gv_order);
        }

        private void bt_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void goods_gridview_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if(e.ColumnIndex==C_DETAIL_INDEX)
            {
                Detail_order f = new Detail_order();
                f.Id = (int)gv_order.CurrentRow.Cells["c_id"].Value;
                f.ShowDialog();
            }
        }
    }
}
